Announcement

Collapse
No announcement yet.

OSL – strengths and limitations

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #46
    I have a problem when trying to load an *.osl file into the Shader File Name Slot of the OSL Material
    // Error: OSL shader error : OSL include path not set
    Did I miss anything?
    Tried several OSL Files, error ist always the same.
    Running vray from a network installation
    Maya2015 + vray_adv_31501_maya2015_x64_26536 nightly build

    Thanks in advance
    Last edited by CAPTURE_MM; 16-12-2015, 09:26 AM.

    Comment


    • #47
      Probably you don't have this VRAY_OSL_PATH_MAYAnnnn_x64 variable set.
      Check the docs for more details: http://docs.chaosgroup.com/display/V...om+a+.zip+File
      V-Ray developer

      Comment


      • #48
        indeed.....
        it works now!
        thank you

        Comment


        • #49
          Originally posted by t.petrov View Post
          In the recent nightlies I've modified the translator and now it is possible to detect in a shader if a texture has a connection or not.
          If you have access to the nightlies you can try it right away, if not it will be available in the next SP - 3.1.
          A little follow-up on this...

          The Cook-Torrance OSL calls the gettextureinfo like this
          Code:
          color getTextureColor(string texture_name, color no_texture_default_color)
          {
              int channels = -1;
              if (gettextureinfo(texture_name, "channels", channels))
              {
                  return texture(texture_name, u, v);
              }
              
              return no_texture_default_color;
          }
          but then has both an input for the texture map AND for a color swatch:
          Code:
          color diffuse_color = 0.5,
          string diffuse_color_texture = "diffuse_color_texture.bmp",
          The idea however is to have one color input that will work with a texture, but have a default color if there is no texture (which how all the color swatches wotk in Maya for every material). So I tried doing this:
          Code:
          color diffuse_color = getTextureColor(diffuse_color, color(0.5,0.5,0.5));
          This sort of works. It takes a texture map, and will even use the default color if there is no texture input. However the swatch itself is still black (even though the shader uses the default grey). You can also change the color of the swatch and it will take the color, which is good. Unless it is set to black, in which case it uses the default value. So... better... but still not quite the same as the way a color swatch works in Maya.

          Anyone have any idea how we might get this to work? I wish we could just input a map into a color type, rather than into a string. I also really wish floats displayed as sliders instead of displaying as number inputs.
          Last edited by sharktacos; 13-05-2016, 06:37 AM.

          Comment


          • #50
            That's the thing I'm noticing with OSL as well, and for VRay it might come from how it's set up in max, where texture inputs and color swatches are in fact two different things.
            Rens Heeren
            Generalist
            WEBSITE - IMDB - LINKEDIN - OSL SHADERS

            Comment


            • #51
              Another way to fix this is to add the "missingcolor" parameter to the texture type.

              Code:
              color Diffuse_color = texture (Diffuse_color, u, v, "missingcolor", color(1,0,0));
              From the OSL manual: "If present, supplies a missing color (and alpha value) that will be used for missing
              or broken textures"

              However this appears not to be implemented into Vray's OSL

              Comment


              • #52
                V-Ray is using OSL-1.3 and some features introduced in newer versions of OSL are not available.
                V-Ray developer

                Comment


                • #53
                  Chaos folks: a question for you:

                  Here's the given: The basic idea of OSL is that it combines existing BSDFs. OSL is not used to write BSDFs. Those are intended to be written in C++. One can use the SDK to write BSDFs for Vray in C++.

                  Given that, here's my question: If we were to write a BSDF in C++ for Vray, is there a way for us to integrate that into OSL in Vray? How would we read our BSDF into a VrayOSLMtl as a custom closure?

                  Comment


                  • #54
                    Originally posted by sharktacos View Post
                    Given that, here's my question: If we were to write a BSDF in C++ for Vray, is there a way for us to integrate that into OSL in Vray? How would we read our BSDF into a VrayOSLMtl as a custom closure?
                    We do not support custom closures right now. It is somewhere on the "to do" list, but we've got other OSL stuff to look into first.

                    Best regards,
                    Vlado
                    I only act like I know everything, Rogers.

                    Comment


                    • #55
                      Originally posted by vlado View Post
                      We do not support custom closures right now. It is somewhere on the "to do" list, but we've got other OSL stuff to look into first.

                      Best regards,
                      Vlado

                      Good to know, thanks.

                      Comment

                      Working...
                      X